﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Reflection;
using System.Text;
using AMS.Core.Entities;
using VitCode.Castle.Entities;

namespace AMS.History.Entities
{
    public class AssetInfoRecord:BaseHistoryEntity
    {
        protected string m_Barcode;
        /// <summary>
        /// 资产条形码
        /// </summary>
        public virtual string Barcode
        {
            get { return m_Barcode; }
            set { m_Barcode = value; }
        }

        protected Guid m_BarcodeFormatId;
        /// <summary>
        /// 标签格式控制对象
        /// </summary>
        public virtual Guid BarcodeFormatId
        {
            get { return m_BarcodeFormatId; }
            set { m_BarcodeFormatId = value; }
        }

        protected string m_TypeName;
        /// <summary>
        /// 资产类型别名
        /// </summary>
        public virtual string TypeName
        {
            get { return m_TypeName; }
            set { m_TypeName = value; }
        }

        protected Guid m_AssetTypeId;
        /// <summary>
        /// 资产类别
        /// </summary>
        public virtual Guid AssetTypeId
        {
            get { return m_AssetTypeId; }
            set { m_AssetTypeId = value; }
        }

        protected string m_Name;
        /// <summary>
        /// 名称
        /// </summary>
        public virtual string Name
        {
            get { return m_Name; }
            set { m_Name = value; }
        }

        protected string m_Code;
        /// <summary>
        /// 编号
        /// </summary>
        public virtual string Code
        {
            get { return m_Code; }
            set { m_Code = value; }
        }

        protected string m_ModelNumber;
        /// <summary>
        /// 规格型号
        /// </summary>
        public virtual string ModelNumber
        {
            get { return m_ModelNumber; }
            set { m_ModelNumber = value; }
        }

        protected string m_SizeInfo;
        /// <summary>
        /// 外形尺寸
        /// </summary>
        public virtual string SizeInfo
        {
            get { return m_SizeInfo; }
            set { m_SizeInfo = value; }
        }

        protected Guid m_UnitId;
        /// <summary>
        /// 单位
        /// </summary>
        public virtual Guid UnitId
        {
            get { return m_UnitId; }
            set { m_UnitId = value; }
        }

        protected Guid m_SiteId;
        /// <summary>
        /// 地点
        /// </summary>
        public virtual Guid SiteId
        {
            get { return m_SiteId; }
            set { m_SiteId = value; }
        }

        protected string m_Location;
        /// <summary>
        /// 详细位置
        /// </summary>
        public virtual string Location
        {
            get { return m_Location; }
            set { m_Location = value; }
        }

        protected double m_OriginalValue;
        /// <summary>
        /// 原价值
        /// </summary>
        public virtual double OriginalValue
        {
            get { return m_OriginalValue; }
            set { m_OriginalValue = value; }
        }

        protected Guid m_NatureId;
        /// <summary>
        /// 资产性质
        /// </summary>
        public virtual Guid NatureId
        {
            get { return m_NatureId; }
            set { m_NatureId = value; }
        }

        protected Guid m_SourceId;
        /// <summary>
        /// 资产来源
        /// </summary>
        public virtual Guid SourceId
        {
            get { return m_SourceId; }
            set { m_SourceId = value; }
        }

        protected string m_DepreciationFunction;
        /// <summary>
        /// 折旧方法名称
        /// </summary>
        public virtual string DepreciationFunction
        {
            get { return m_DepreciationFunction; }
            set { m_DepreciationFunction = value; }
        }

        protected double m_DepreciationYears;
        /// <summary>
        /// 折旧年限
        /// </summary>
        public virtual double DepreciationYears
        {
            get { return m_DepreciationYears; }
            set { m_DepreciationYears = value; }
        }

        protected double m_DepreciationRate;
        /// <summary>
        /// 年折旧率
        /// </summary>
        public virtual double DepreciationRate
        {
            get { return m_DepreciationRate; }
            set { m_DepreciationRate = value; }
        }

        protected double m_DepreciationValue;
        /// <summary>
        /// 累计折旧金额
        /// </summary>
        public virtual double DepreciationValue
        {
            get { return m_DepreciationValue; }
            set { m_DepreciationValue = value; }
        }

        protected string m_Supplier;
        /// <summary>
        /// 供应商
        /// </summary>
        public virtual string Supplier
        {
            get { return m_Supplier; }
            set { m_Supplier = value; }
        }

        protected string m_SerialNumber;
        /// <summary>
        /// 出厂编号
        /// </summary>
        public virtual string SerialNumber
        {
            get { return m_SerialNumber; }
            set { m_SerialNumber = value; }
        }

        protected string m_Manufacturers;
        /// <summary>
        /// 制造商
        /// </summary>
        public virtual string Manufacturers
        {
            set { m_Manufacturers = value; }
            get { return m_Manufacturers; }
        }

        protected string m_ShelfLife;
        /// <summary>
        /// 保质期
        /// </summary>
        public virtual string ShelfLife
        {
            get { return m_ShelfLife; }
            set { m_ShelfLife = value; }
        }

        protected double m_UseYears;
        /// <summary>
        /// 使用年限
        /// </summary>
        public virtual double UseYears
        {
            get { return m_UseYears; }
            set { m_UseYears = value; }
        }

        protected Guid m_StateId;
        /// <summary>
        /// 状态
        /// </summary>
        public virtual Guid StateId
        {
            get { return m_StateId; }
            set { m_StateId = value; }
        }

        protected Guid m_DepartmentId;
        /// <summary>
        /// 所属部门
        /// </summary>
        public virtual Guid DepartmentId
        {
            get { return m_DepartmentId; }
            set { m_DepartmentId = value; }
        }

        protected Guid m_UsersId;
        /// <summary>
        /// 使用人
        /// </summary>
        public virtual Guid UsersId
        {
            get { return m_UsersId; }
            set { m_UsersId = value; }
        }

        protected DateTime m_CheckedDate;
        /// <summary>
        /// 
        /// </summary>
        public virtual DateTime CheckedDate
        {
            get { return m_CheckedDate; }
            set { m_CheckedDate = value; }
        }

        protected DateTime m_StartUpDate;
        /// <summary>
        /// 启用时间
        /// </summary>
        public virtual DateTime StartUpDate
        {
            get { return m_StartUpDate; }
            set { m_StartUpDate = value; }
        }

        protected string m_ParentBarcode;
        /// <summary>
        /// 
        /// </summary>
        public virtual string ParentBarcode
        {
            get { return m_ParentBarcode; }
            set { m_ParentBarcode = value; }
        }

        private double m_EndValue;

        /// <summary>
        /// 净价值
        /// </summary>
        public virtual double EndValue
        {
            get { return m_EndValue; }
            set { m_EndValue = value; }
        }



        /// <summary>
        /// 重写Equals方法
        /// </summary>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(obj, this))
                return true;
            if (obj == null)
                return false;
            var sObj = obj as AssetInfoRecord;
            return sObj != null && (sObj.HId == m_HId || (sObj.HBaseObjectId == m_HBaseObjectId && sObj.HVersionId!=m_HVersionId));
        }

        /// <summary>
        /// 重写GetHashCode方法
        /// </summary>
        public override int GetHashCode()
        {
            int hash = 37;
            hash = 15 * hash * m_HId.GetHashCode();
            return hash;
        }

        /// <summary>
        /// 重写ToString方法
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return m_Barcode;
        }
    }
}
